﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    防伪码管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            防伪码管理
        </div>
        <div class="options">
        </div>
    </div>
    <table width="100%">
        <tr>
            <td class="adminTitle">
                <img alt="SN" src="<%=Url.Content("~/Content/images/ico-help.gif") %>" title="SN"></img><label
                    for="operationName" title="SN">SN</label>:
            </td>
            <td class="adminData">
                <%=Html.TextBox("QuerySN")%>
            </td>
        </tr>
    </table>
    <p>
    </p>
    <table class="adminContent">
        <tr>
            <td>
                <%Html.Telerik().Grid<Micrhard.FMCG.Server.Models.FakeCodeModel>((List<Micrhard.FMCG.Server.Models.FakeCodeModel>)this.Model.Data)
                    .Name("operation-grid")
                    .ToolBar(t => t.Template(g =>
                    { %>
                <%var searchParms = new Dictionary<string, string>();
                  searchParms.Add("SN", "QuerySN");
                %>
                <div class="header-menu">
                    <ul class="t-widget t-reset t-header t-menu">
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_SearchButton("btnSearch", "查询", "operation-grid", searchParms, "OperationGridOnGridDataBinding")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_AddButton("btnAdd", "导入", "Create", "VerifyFake")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_DeleteButton("btnDelete", "删除", "operation-grid", "Delete", "VerifyFake", "ScanWXCode")%>
                        </li>
                    </ul>
                </div>
                <%}))
                         .ClientEvents(events => events.OnDataBinding("OperationGridOnGridDataBinding"))
                         .Columns(columns =>
                    {
                        columns.Bound(x => x.FakeCodeID)
                       .Template(x => Html.CheckBox("checkedRecords", new { value = x.FakeCodeID, @class = "gridCks" }))
                       .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= FakeCodeID #>' class='gridCks'/>")
                     .HtmlAttributes(new { style = "text-align:center" }).Title("选择");

                        columns.Bound(x => x.SN).Title("SN");
                        columns.Bound(x => x.Code).Title("Code");
                        columns.Bound(x => x.CreateTime).Title("创建时间");
                        columns.Bound(x => x.VerfyTime).Title("第一次验证时间");
                        columns.Bound(x => x.LatestTime).Title("最近验证时间");
                        columns.Bound(x => x.Count).Title("验证次数");
                        columns.Bound(x => x.IpAddress).Title("验证IP");
                        columns.Bound(x => x.Info).Title("验证信息");
                        columns.Bound(x => x.Status).Title("状态");
                    })
                      .Pageable(settings => settings.Total(Model.Total).PageSize(Html.GetGridPageSize()).Position(GridPagerPosition.Top))
                      //绑定搜索按钮，执行对应的action
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("_List", "VerifyFake"))
                    .EnableCustomBinding(true)
                    .Render();
                %>
            </td>
        </tr>
    </table>
</asp:Content>
